x86/vpmu: Harden indirect branches
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 30 Nov 2021 21:31:55 +0000 (21:31 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Feb 2022 15:33:43 +0000 (15:33 +0000)
commite826cf735171ad032901abdc4a1c46ecca401562
tree69184109a799b5191ec8f313488fc928d77d3296
parent8f473f92e531d1189b03a2e4acdf87ff0f029f30
x86/vpmu: Harden indirect branches

As all function pointer calls are resolved to direct calls on boot, clobber
the endbr64 instructions too to make life harder for an attacker which has
managed to hijack a function pointer.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/vpmu_amd.c
xen/arch/x86/cpu/vpmu_intel.c